import pandas as pd
import numpy as np
'''
path = './csv/test.csv'
with open(path)as file:
    data=pd.read_csv(file)
    head_data = data.head(2)
    print(head_data)
    print(data.loc[0][3])

    head_data.to_csv('./csv/test_output.csv')
'''

dct = {
    'one':[1,1,1],
    'two':[2,2,2],
    'three':[3,3,3]
}

lst = [
    [1,1,1,1,1,1,1,1,1],
    [2,2,2,2,2,2,2,2,2],
    [3,3,3,3,3,3,3,3,3]
]

lst2 = [
    [4,1,1,1,1,1,1,1,1],
    [5,2,2,2,2,2,2,2,2],
    [6,3,3,3,3,3,3,3,3]
]

a = np.array(lst2)

#对于字典
#'columns'按列
#'index'按行

#对于字典columns 按行
new_df = pd.DataFrame.from_dict(lst,orient='columns')
new_df2 = pd.DataFrame.from_dict(a,orient='columns')
#new_df = pd.DataFrame.from_arrays(lst,orient='index')

#追加
new_df2.to_csv('new_t.csv',mode='a',header=False)


